import javax.swing.BoxLayout;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTree;
import javax.swing.event.TreeSelectionEvent;
import javax.swing.event.TreeSelectionListener;
import org.rsbot.script.wrappers.RSComponent;

class InterfaceExplorer$1
  implements TreeSelectionListener
{
  private void addInfo(String paramString1, String paramString2)
  {
    JPanel localJPanel = new JPanel();
    localJPanel.setAlignmentX(0.0F);
    localJPanel.setLayout(new BoxLayout(localJPanel, 0));

    for (String str : new String[] { paramString1, paramString2 }) {
      JLabel localJLabel = new JLabel(str);
      localJLabel.setAlignmentY(0.0F);
      localJPanel.add(localJLabel);
    }
    InterfaceExplorer.access$200(this.this$0).add(localJPanel);
  }

  public void valueChanged(TreeSelectionEvent paramTreeSelectionEvent) {
    Object localObject = InterfaceExplorer.access$300(this.this$0).getLastSelectedPathComponent();
    if ((localObject == null) || ((localObject instanceof InterfaceExplorer.RSInterfaceWrap))) {
      return;
    }

    InterfaceExplorer.access$200(this.this$0).removeAll();
    RSComponent localRSComponent = null;
    if ((localObject instanceof InterfaceExplorer.RSComponentWrap)) {
      InterfaceExplorer.access$402(this.this$0, ((InterfaceExplorer.RSComponentWrap)localObject).wrapped.getArea());

      localRSComponent = ((InterfaceExplorer.RSComponentWrap)localObject).wrapped;
    }
    if (localRSComponent == null) {
      return;
    }
    addInfo("Action type: ", "-1");
    addInfo("Type: ", "" + localRSComponent.getType());
    addInfo("SpecialType: ", "" + localRSComponent.getSpecialType());
    addInfo("Bounds Index: ", "" + localRSComponent.getBoundsArrayIndex());
    addInfo("Model ID: ", "" + localRSComponent.getModelID());
    addInfo("Texture ID: ", "" + localRSComponent.getBackgroundColor());
    addInfo("Parent ID: ", "" + localRSComponent.getParentID());
    addInfo("Text: ", "" + localRSComponent.getText());
    addInfo("Tooltip: ", "" + localRSComponent.getTooltip());
    addInfo("SelActionName: ", "" + localRSComponent.getSelectedActionName());
    if (localRSComponent.getActions() != null) {
      String str1 = "";
      for (String str2 : localRSComponent.getActions()) {
        if (!str1.equals("")) {
          str1 = str1 + "\n";
        }
        str1 = str1 + str2;
      }
      addInfo("Actions: ", str1);
    }
    addInfo("Component ID: ", "" + localRSComponent.getComponentID());
    addInfo("Component Stack Size: ", "" + localRSComponent.getComponentStackSize());
    addInfo("Relative Location: ", "(" + localRSComponent.getRelativeX() + "," + localRSComponent.getRelativeY() + ")");
    addInfo("Absolute Location: ", "(" + localRSComponent.getAbsoluteX() + "," + localRSComponent.getAbsoluteY() + ")");

    InterfaceExplorer.access$200(this.this$0).validate();
    InterfaceExplorer.access$200(this.this$0).repaint();
  }
}